function [clusterIdx, H_normalized] = RMSC_config_auto(Ks, nCluster)
[nSmp, ~, nKernel] = size(Ks);
T = zeros(nSmp, nSmp, nKernel);
for j=1:nKernel
    D=diag(sum(Ks(:,:,j),2));
    L_rw=D^-1*Ks(:,:,j);
    T(:,:,j)=L_rw;
end
clear Ks;

lambda=0.005;
options = [];
options.DEBUG=0;
options.eps=1e-6;
options.max_iter=300;
P_hat=RMSC(T, lambda, options);

opts.disp = 0;
[H, ~] = eigs(P_hat, nCluster, 'lm', opts);
H_normalized = H ./ repmat(sqrt(sum(H.^2, 2)), 1,nCluster);
clusterIdx = litekmeans(H_normalized, nCluster, 'MaxIter',100, 'Replicates', 50);